package com.security.door.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.security.door.core.base.BaseService;
import com.security.door.dao.mapper.baseRoleMapper;
import com.security.door.model.domain.baseRole;
import com.security.door.model.dto.baseRoleDto;
import com.security.door.service.IbaseRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class baseRoleServiceImpl extends BaseService<baseRole> implements IbaseRoleService {

    @Autowired
    baseRoleMapper ibaseRoleMapper;

    @Override
    public PageInfo<baseRole> queryListWithPage(baseRoleDto entity) {
        PageHelper.startPage(entity.getPageIndex(), entity.getPageSize());
        var actionList = ibaseRoleMapper.queryListWithPage(entity);
        return new PageInfo<>(actionList);
    }

    @Override
    public int deleteByRoleCode(Integer roleCode) {
        return ibaseRoleMapper.deleteByRoleCode(roleCode);
    }

    @Override
    public int getCount() {
        return ibaseRoleMapper.getCount();
    }

    @Override
    public int checkCode(Integer RoleCode) {
        return ibaseRoleMapper.checkCode(RoleCode);
    }

    @Override
    public int getMaxID() {
        return ibaseRoleMapper.getMaxID();
    }

}
